package com.example.demo.mapper;


import com.example.demo.entity.Personalinfo;
import com.example.demo.entity.SafeAnswerinfo;
import com.example.demo.entity.SafeQuestioninfo;
import com.example.demo.entity.Userinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PersonalMapper {

    //展示个人信息
    Personalinfo showPersonalInfo(@Param("uid") Integer uid);

    //更新个人信息
    int update(Personalinfo personalinfo);

    //得到当前用户的密保问题
    List<SafeQuestioninfo> getSafeQuestion(@Param("uid") Integer uid, @Param("i") Integer i);

    //得到当前用户的密保答案
    List<SafeAnswerinfo> getAnswer(@Param("uid") Integer uid);

    //根据uid qid查询有没有此密保答案
    SafeAnswerinfo getAnswerByUidQid(SafeAnswerinfo answerinfo);

    //插入数据
    int addAnswerByUidQid(SafeAnswerinfo answerinfo);

    //更新数据
    int updateAswerByUidQid(SafeAnswerinfo answerinfo);

    //更新密码
    int updatePassword( @Param("newpwd") String newpwd,@Param("id") Integer id);

    //注册时添加默认个人信息
    int addPersonal(Userinfo userinfo);
}
